package com.zshy.base.core.contract.constant;

/**
 * 常用上下文对象常量名，本地线程持有
 *
 * @author zhouhengzhe
 * @公众号 小白的Java进阶之路
 */
public abstract class ContextConstants {
    public static final String TENANT_ID = "tenant-id";
    public static final String PREPARING_SQL = "preparing-sql";
    public static final String SQL_PARAMS = "sql-params";
    public static final String LAST_SQL_SPENDS = "last-sql-spends";
    public static final String SYSTEM_ID = "system-id";
    public static final String IP = "ip";
    public static final String AUTHORIZATION = "Authorization";
    public static final String SEE = "see";

    /**
     * 中国国际区号
     */
    public static final String CHINA_COUNTRY_CODE = "86";

    public static final String AREA_CODE = "areaCode";

    public static final String UUID_PREFIX = "UC";

    public static final String ID_CARD_PATTERN = "^\\d{15}|\\d{17}[\\dXx]$";

    public static String PROJECT_PACKAGE = "project-package";

    public static String MODEL_PO = "MODEL_PO";
    public static String MODEL_QUERY = "MODEL_QUERY";
    public static String MODEL_NAME = "MODEL_NAME";


    /**
     * email
     */
    public static final String EMAIL_PATTERN = "^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@" + "[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";


    /**
     * phone
     */
    public static final String PHONE_PATTERN = "^1[3|4|5|6|7|8][0-9]\\d{8}$";


    /**
     * QQ
     */
    public static final String QQ_PATTERN = "^[1-9][0-9]{4,10}$";

    /**
     * 密码
     */
    public static final String PWD_PATTERN = "^(?![0-9A-Za-z]+$)(?![0-9A-Z\\W]+$)(?![0-9a-z\\W]+$)(?![A-Za-z\\W]+$)[0-9A-Za-z~!@#$%^&*()_+`\\-={}|\\[\\]\\\\:\";'<>?,./]{6,20}$";

    /**
     * 日期
     */
    public static final String DATE_PATTERN = "yyyy-MM-dd";

    /**
     * url
     */
    public static final String URL_PATTERN =
            "^(?:http|https|ftp)://(?:\\S+(?::\\S*)?@)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:/[\\w\\u00a1-\\uffff-./?%&=]*)?$";

}
